package com.weds.test_driver;

import com.weds.common_service.ArchiveDto;
import com.weds.data_sync_api.api.top.ApiConsumer;
import com.weds.data_sync_api.api.top.ApiFullSync;
import com.weds.data_sync_api.api.top.ApiIncrementSync;
import com.weds.data_sync_api.api.top.ApiProducer;
import com.weds.data_sync_api.entity.ProducerEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description 测试数据交换
 * @Author lihw
 * @Date 2024/2/26 16:12
 */

public class TestDataSwap implements ApiProducer<ArchiveDto>, ApiConsumer<ArchiveDto>, ApiIncrementSync<CustomSyncEntity>, ApiFullSync<CustomSyncEntity> {

    @Override
    public void consumer(List<ArchiveDto> consumeList) {
        /**
         * 数据类型转换: dto -> do
         * do 消费者消费
         */
        System.out.println("TestDataSwap consumer");
    }

    @Override
    public <P extends ProducerEntity> List<ArchiveDto> producer(P producerParam) {
        /**
         * 生产者生产数据: 生产dto
         */
        System.out.println("TestDataSwap producer");

        return new ArrayList<>();
    }

    /**
     * 全量同步
     *
     * @param syncParams
     */
    @Override
    public void fillSync(CustomSyncEntity syncParams) {
        System.out.println("全量同步逻辑");
    }

    /**
     * 增量同步
     *
     * @param syncParams
     */
    @Override
    public void incrementSync(CustomSyncEntity syncParams) {
        System.out.println("增量同步逻辑");
    }
}
